<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    ul li {
      cursor: pointer;
    }
  </style>
</head>

<body>
  <ul>
    <li onclick="jumpTo('polling')">polling</li>
    <li onclick="jumpTo('longpolling')">polling 长轮询</li>
    <li onclick="jumpTo('stream')">http stream</li>
    <li onclick="jumpTo('sse')">Server-sent Events</li>
  </ul>
  <script type="text/javascript">
    window.onload = function () {}

    function jumpTo(str) {
      console.log(str);
      switch (str) {
        case 'polling':
          window.location.href = 'http://localhost:8088/polling-page';
          break;
        case 'longpolling':
          window.location.href = 'http://localhost:8088/longpolling-page';
          break;
        case 'stream':
          window.location.href = 'http://localhost:8088/stream-page';
          break;
        case 'sse':
          window.location.href = 'http://localhost:8088/sse-page';
          break;
        default:
          window.location.href = 'http://localhost:8088/';
          break;
      }
    }
  </script>
</body>

</html>
